UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'syds290P7Ph6QUFhTKly8NNbVtPTjDVo8YWTSSiLONg='
WHERE
key_id = 'ab5d1033c10c9de2c6aea9b489169e227286917fee9230bb21ec23c93b1db6fb'
AND (
token = 'syds290P7Ph6QUFhTKly8NNbVtPTjDVo8YWTSSiLONg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)