UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JDPKfPJstKeVRgOpB71T+70l1GQUz1ODmOWVrjeu754='
WHERE
key_id = 'd403e4d3bb838eb8ac48e3fa38175134dac9ff9666b3e4f85286f75ca368c2b1'
AND (
token = 'JDPKfPJstKeVRgOpB71T+70l1GQUz1ODmOWVrjeu754='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)