UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rE9gGY7uXM09xkFScIZ9DBcUDcAGxep/8eXkk2H/ytE=' 
WHERE 
  key_id = '3a44552dabc80f52c2e3183822384772a60f6dda39bf2335f14a3c7f32efb65b' 
  AND (
    token = 'rE9gGY7uXM09xkFScIZ9DBcUDcAGxep/8eXkk2H/ytE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026