UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wgONUQFOtpQdyuNsThyTXGJ28b1qrQyDz8OxKgtiqL8='
WHERE
key_id = '377105581da498997171abf44bc3613ddd9fa2a5b23a25b08523cb189bba5fe7'
AND (
token = 'wgONUQFOtpQdyuNsThyTXGJ28b1qrQyDz8OxKgtiqL8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)