UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DwfSA7JphLvqH9QITPpDrYeH00tK0lySSR/9CfIeI60='
WHERE
key_id = '5b894e6caf0195605a30335a01291a8c177a28dc68bfd2b2c0b555a0703c6dcb'
AND (
token = 'DwfSA7JphLvqH9QITPpDrYeH00tK0lySSR/9CfIeI60='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)