UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XGEs6Sr94IRz5nNS0xjG00uuSykRSvNHdeDlTUjxUGA='
WHERE
key_id = '8dc7f62621946a7a697fe25a2930f71d1cc23abe8dc2f347744dafb382d3a199'
AND (
token = 'XGEs6Sr94IRz5nNS0xjG00uuSykRSvNHdeDlTUjxUGA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)