UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ohf28QvUa2oBrxv4ySTvE66Lzuqu/3GjPphRix2hcq8='
WHERE
key_id = 'c4d1c99f676ba92426ad015a15f08c52e40d26ef0da533abefa56ae184518665'
AND (
token = 'ohf28QvUa2oBrxv4ySTvE66Lzuqu/3GjPphRix2hcq8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)