UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9CkhI13JPkLtWqzkhjyxKfe0a85/iZP5DR4zVvmUyyE=' 
WHERE 
  key_id = '1d327632d1b1d0d67c5bbda8304134a494f2ec9c5278891c20be5556f74c1b03' 
  AND (
    token = '9CkhI13JPkLtWqzkhjyxKfe0a85/iZP5DR4zVvmUyyE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034