UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '24PKGGW7OWyvpNjx5wWXE0GXtCSWWGFPcl2x7+GrgVY='
WHERE
key_id = '2f95434c5b2429ee3cac0dd9754d9fdb3fb66cb99797ac4b96f3b90ebaf41cd2'
AND (
token = '24PKGGW7OWyvpNjx5wWXE0GXtCSWWGFPcl2x7+GrgVY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)