UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PdFwRiIICtNMAP6ArLpA49dU/YGG88pCGGuOgiVppww='
WHERE
key_id = '65771082dd6e59973ca4ae42885d59e890f9df3f49cfa89f3a66bc20e6c92d86'
AND (
token = 'PdFwRiIICtNMAP6ArLpA49dU/YGG88pCGGuOgiVppww='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)