UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HjWQIjUpbugEKWWeJlKsfX0Mt0H1m62ClCcnXgqc/Nc=' 
WHERE 
  key_id = '906a4601b45e882d9ae4175ee237d15ac36f9ff86bb3806fc99ad376728cff40' 
  AND (
    token = 'HjWQIjUpbugEKWWeJlKsfX0Mt0H1m62ClCcnXgqc/Nc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021