UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NE2hHZ4suFOO2B/YczbfCcMdKpwUXneUmbKR9P8kcQQ=' 
WHERE 
  key_id = '2195c5a658e2919782bceef8be4de321d52865cf8d36354bb7e384ad89ab2a22' 
  AND (
    token = 'NE2hHZ4suFOO2B/YczbfCcMdKpwUXneUmbKR9P8kcQQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028