UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fXeoBeT8RJmWYyy4zTjvACUWLTEwP6zhXfgq7mZwduM='
WHERE
key_id = '2d762f753d39fe05aa4816725cde3e0bfa2ad9f66a0c5b4daeb7916861fac629'
AND (
token = 'fXeoBeT8RJmWYyy4zTjvACUWLTEwP6zhXfgq7mZwduM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)