UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vSGYslWnPpOcnHlOqcZzdr+rf1r4g3wg/emrDaPil4Y='
WHERE
key_id = '8f4fadf01b3f085f041c13be6066e0f27652a95e2e9ff015cbf99bc2c85b2198'
AND (
token = 'vSGYslWnPpOcnHlOqcZzdr+rf1r4g3wg/emrDaPil4Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)