UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6g4H6hwGVZfAIPWYVBjAJw3OVC8R4UdSInpwEsaNoB8='
WHERE
key_id = '24b04e194771c0c4f6f169af074c3952eb826464a7ad03410d6c1ab248ffc367'
AND (
token = '6g4H6hwGVZfAIPWYVBjAJw3OVC8R4UdSInpwEsaNoB8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)