UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nju0aLW8s94PJ8GFjhkQ8d5EGv6M8a8dkiqeLMpGWzw='
WHERE
key_id = '6df6b58e20201e76c1fc3702ceedfcb2e4d9c442a1f8ef5e0c2ab698cda05c74'
AND (
token = 'nju0aLW8s94PJ8GFjhkQ8d5EGv6M8a8dkiqeLMpGWzw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)