UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4PgpIPkLFAuIviPs5wWYgu3hfg4Q/MM7OjfN1YW8k8I='
WHERE
key_id = '56935ff4790bdd62905e812ae960576d61ce31257348ff49ce9b4279094eed58'
AND (
token = '4PgpIPkLFAuIviPs5wWYgu3hfg4Q/MM7OjfN1YW8k8I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)