UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '54W1V1Y53UetBSDZ1wNAz88VSP7bJDyF9CDUNE5c6Ro='
WHERE
key_id = '0efd447f0eb25f0965817dfa8810878aeaf21084fe9fb8637ad5d0b9e34114c1'
AND (
token = '54W1V1Y53UetBSDZ1wNAz88VSP7bJDyF9CDUNE5c6Ro='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)