UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qP1KMuIF3DrHo4fM/pap+lCPexkavNQc3vRZnVDZRxc=' 
WHERE 
  key_id = 'b65b0a53db3f8a0c075d44442974bf7f38aef8f5b1204b7dc72367ec0ffd7b44' 
  AND (
    token = 'qP1KMuIF3DrHo4fM/pap+lCPexkavNQc3vRZnVDZRxc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041