UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J2sUWFklr3eZUCwqnzGEccOacKBktLs9M3LqGmpIhw8='
WHERE
key_id = '444b1e8aab5717b0c0aaf5f432d72c825a2049d0123e271b6d37c5f18c59051b'
AND (
token = 'J2sUWFklr3eZUCwqnzGEccOacKBktLs9M3LqGmpIhw8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)