UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rGcRfMdTK+DRIG6hdZ2+5388btDJqrRXCwBDRVP7JME='
WHERE
key_id = 'cec6a8ab5c7079098cf0c51eabef92d654715b1b79eab1d60cb69db487b8596e'
AND (
token = 'rGcRfMdTK+DRIG6hdZ2+5388btDJqrRXCwBDRVP7JME='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)