UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0wH/XAS7OOzg3L4SiGDapPpTdTnPpTtRLwAPSIWhvIo='
WHERE
key_id = '1b8cfc40a9e8f3221f082e1c0dd1524e95521ce71f79daaa65af3cfb742c8aa5'
AND (
token = '0wH/XAS7OOzg3L4SiGDapPpTdTnPpTtRLwAPSIWhvIo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)