UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UQMOMpdE4OyttDPKfP2Hlp/Neq+LUIQ5g3F4oBgVPcc='
WHERE
key_id = 'd042ca3ae974f3d0abd5fb02486a96f77fc3e5f1922fe853b023a832dce08adf'
AND (
token = 'UQMOMpdE4OyttDPKfP2Hlp/Neq+LUIQ5g3F4oBgVPcc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)