UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qVvZEvUaiTV1PazmR2SjPfHipwb7HwE7XPhrN/Dv50w='
WHERE
key_id = '8267108a52178bdf68eea4ef5e4e1d81377e0ddf4e8d7dcaf8eec9b104f731a2'
AND (
token = 'qVvZEvUaiTV1PazmR2SjPfHipwb7HwE7XPhrN/Dv50w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)