UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0vfJ4pBipypv+DXWrCA2DrAuLP/foRm4vQi6Jn8qWZE='
WHERE
key_id = 'f1b828fd02aec0b25d42759aae382374a02e2d8079362820584cfb43775b29b1'
AND (
token = '0vfJ4pBipypv+DXWrCA2DrAuLP/foRm4vQi6Jn8qWZE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)