UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4lWslXmVcvh7Q0AXIEgJaCyHmfRCT0Zb3OA3TQ5wcJM='
WHERE
key_id = 'c4f72f5f90f0de97f04229d086a853766a37a7f92e53ac216422a89e24acd804'
AND (
token = '4lWslXmVcvh7Q0AXIEgJaCyHmfRCT0Zb3OA3TQ5wcJM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)