UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3OUI2pGdyPFCE3h4KD7j+UlurbqDtBGL9dEjbTMA1co='
WHERE
key_id = '188afb8f5eb5bae5507630f17b24da63e39191a58d4b1d87bb49547d0cbd85c0'
AND (
token = '3OUI2pGdyPFCE3h4KD7j+UlurbqDtBGL9dEjbTMA1co='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)