UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jOzpxQRDAWmlhQHNfvu0A2iUkQfEUc0/CEpKlDeiO5E='
WHERE
key_id = '795d91a685fc16571139d9887eeaa17e0b84538cf8f8de2400dd7d72e62ba58e'
AND (
token = 'jOzpxQRDAWmlhQHNfvu0A2iUkQfEUc0/CEpKlDeiO5E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)