UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P5rkkovgJQ1SkkVCZIlVQPnXVTMBB8ACcMx9ikFdiWI='
WHERE
key_id = '0185b20e2d3acee9b474e4fff861861960ee4c760f66072dc9f535ffd749c1ba'
AND (
token = 'P5rkkovgJQ1SkkVCZIlVQPnXVTMBB8ACcMx9ikFdiWI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)