UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZOWWzYWY6FoMaf0qPQVfuwF+RZBK1ldv/1EVMnLo5KE='
WHERE
key_id = 'a27c69fcf7e63afb082d1c72ae6b33d9174f68b513a355ded8f023647602019d'
AND (
token = 'ZOWWzYWY6FoMaf0qPQVfuwF+RZBK1ldv/1EVMnLo5KE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)