UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sDuN/hySfzTGle4sUjU65HIbcPtZqVn0sJsomh8M/Nk='
WHERE
key_id = '382c352f9a24fc78bdd00e8c12a0de6a95d952ff6b24fb0b3434ebbe6e9e3ebb'
AND (
token = 'sDuN/hySfzTGle4sUjU65HIbcPtZqVn0sJsomh8M/Nk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)