UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uDe10ig30JA0r313jRFDc8ZnbTpWnwl0NImKe68Y/Ao='
WHERE
key_id = 'fda7be9c105c9d537a9c47489e581c1c0303ebdc76d0e84bbee9c8bc341481a5'
AND (
token = 'uDe10ig30JA0r313jRFDc8ZnbTpWnwl0NImKe68Y/Ao='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)